import { createVNode, render } from 'vue'
import Dialog from './dialog.vue'

const ImageViewer = (options) => {
  const Destory = () => {
    render(null, container)
  }

  const container = document.createElement('div')
  const props = { ...options, Destory }
  const vm = createVNode(Dialog, props)

  render(vm, container)
  document.body.appendChild(container.firstElementChild)
}

export { ImageViewer }
export default ImageViewer
